﻿using System;
using System.Net;

using System.Runtime.Serialization;
using System.Collections.Generic;
using System.ComponentModel;


namespace ELMApplication.Web.DataModel
{
    [DataContract]
    public class Dataflow : INotifyPropertyChanged
    {
        private int _quantity;
        [DataMember]
        public int ID { get; set; }
        private Human _receiver;
        private string _subTaskName;
        [DataMember]
        public string OutflowId { get; set; }
        [DataMember]
        public string InfoClass { get; set; }
        [DataMember]
        public DateTime CreateDate { get; set; }
        [DataMember]
        public string OutStatus { get; set; }
        [DataMember]
        public int MaxIndex { get; set; }
        [DataMember]
        public string TaskID { get; set; }
        [DataMember]
        public string SubTaskId { get; set; }
        [DataMember]
        public DateTime StartDate { get; set; }
        [DataMember]
        public DateTime? FinishDate { get; set; }
        [DataMember]
        public int Quantity
        {
            get
            { return _quantity; }

            set
            {
               
                    _quantity = value;
               
                
            }
        }
        [DataMember]
        public string UnitName { get; set; }
        [DataMember]
        public string SubTaskName
        {
            get { return _subTaskName; }
            set
            {
                _subTaskName = value;
                NotifyPropertyChanged("SubTaskName");
            }
        }
        [DataMember]
        public string SubTaskContent { get; set; }

        [DataMember]
        public Human SenderUser { get; set; }

        [DataMember]
        public Human ReceiveUser
        {
            get { return _receiver; }
            set
            {
                _receiver = value;
                NotifyPropertyChanged("ReceiveUser");
            }
        }

        [DataMember]
        public Matter Matter { get; set; }
        /// <summary>
        /// 当前用户当前任务如果要发起新子流程的索引编号
        /// </summary>
        [DataMember]
        public int CurrentOutMSGMaxIndex { get; set; }
        [DataMember]
        public List<Human> AllHuman { get; set; }
        [DataMember]
        public List<Matter> AllMatter { get; set; }

        [DataMember]
        public List<Attachment> Attachments { get; set; }



        #region INotifyPropertyChanged Members

        public event PropertyChangedEventHandler PropertyChanged;
        private void NotifyPropertyChanged(string propertyName)
        {
            if (PropertyChanged != null)
            {
                PropertyChanged(this, new PropertyChangedEventArgs(propertyName));
            }
        }

        #endregion
    }
}
